/*
 * HeatMetaDataBO.java 
 * 
 * Copyright 2009 Wangfeng Beijing Inc. 
 * All rights reserved. 
 * 
 * Created on 2012-07-09
 */

package com.bjtech.domain.query;

import java.util.Date;

import org.ssi.web.util.QuerySpecTpl;

import com.bjtech.web.util.SelectBean;

/**
 * 功能概述:热量表数据 <br>
 * 
 * @author 王峰
 */

public class HeatMetaDataQuerySpec extends SelectBean {
	/* */
	private Long id;
	/* */
	private String meter_num;
	/* */
	private Float sum_heat;
	/* */
	private String sum_heat_unit;
	/* */
	private Float sum_flow;
	/* */
	private Date record_time;
	/* */
	private Float instant_power;
	/* */
	private Float sup_water_temp;
	/* */
	private Float back_water_temp;
	/* */
	private Float temp_diff;
	/* */
	private Float instant_flow;
	/* */
	private Float run_hours;
	/* */
	private Float wrong_hours;
	/* */
	private Float sys_hours;
	/* */
	private String wrong_info;
	/* */
	private String demo;

	@Override
	public void queryParamString() {
		StringBuilder fromPart = new StringBuilder(" where 1=1");

		if (this.isAll != null && this.isAll.intValue() != 1) {
			if (QuerySpecTpl.isValid(id)) {
				fromPart.append(" and a.id = ");
				fromPart.append(id);
			}

			if (QuerySpecTpl.isValid(meter_num)) {
				fromPart.append(" and a.meter_num like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(meter_num);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(sum_heat)) {
				fromPart.append(" and a.sum_heat = ");
				fromPart.append(sum_heat);
			}

			if (QuerySpecTpl.isValid(sum_heat_unit)) {
				fromPart.append(" and a.sum_heat_unit like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(sum_heat_unit);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(sum_flow)) {
				fromPart.append(" and a.sum_flow = ");
				fromPart.append(sum_flow);
			}

			if (QuerySpecTpl.isValid(record_time)) {
				fromPart.append(" and a.record_time = ");
				fromPart.append(record_time);
			}

			if (QuerySpecTpl.isValid(instant_power)) {
				fromPart.append(" and a.instant_power = ");
				fromPart.append(instant_power);
			}

			if (QuerySpecTpl.isValid(sup_water_temp)) {
				fromPart.append(" and a.sup_water_temp = ");
				fromPart.append(sup_water_temp);
			}

			if (QuerySpecTpl.isValid(back_water_temp)) {
				fromPart.append(" and a.back_water_temp = ");
				fromPart.append(back_water_temp);
			}

			if (QuerySpecTpl.isValid(temp_diff)) {
				fromPart.append(" and a.temp_diff = ");
				fromPart.append(temp_diff);
			}

			if (QuerySpecTpl.isValid(instant_flow)) {
				fromPart.append(" and a.instant_flow = ");
				fromPart.append(instant_flow);
			}

			if (QuerySpecTpl.isValid(run_hours)) {
				fromPart.append(" and a.run_hours = ");
				fromPart.append(run_hours);
			}

			if (QuerySpecTpl.isValid(wrong_hours)) {
				fromPart.append(" and a.wrong_hours = ");
				fromPart.append(wrong_hours);
			}

			if (QuerySpecTpl.isValid(sys_hours)) {
				fromPart.append(" and a.sys_hours = ");
				fromPart.append(sys_hours);
			}

			if (QuerySpecTpl.isValid(wrong_info)) {
				fromPart.append(" and a.wrong_info like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(wrong_info);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(demo)) {
				fromPart.append(" and a.demo like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(demo);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(this.direction)
					&& QuerySpecTpl.isValid(this.sort)) {
				fromPart.append(" order by ");
				fromPart.append(this.sort);
				fromPart.append(" ");
				fromPart.append(this.direction);
			} else {
				fromPart.append(" order by ");
				fromPart.append("id");
				fromPart.append(" ");
				fromPart.append("asc");

			}
		}
		super.setQueryString(fromPart.toString());
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getMeter_num() {
		return this.meter_num;
	}

	public void setMeter_num(String meter_num) {
		this.meter_num = meter_num;
	}

	public Float getSum_heat() {
		return this.sum_heat;
	}

	public void setSum_heat(Float sum_heat) {
		this.sum_heat = sum_heat;
	}

	public String getSum_heat_unit() {
		return this.sum_heat_unit;
	}

	public void setSum_heat_unit(String sum_heat_unit) {
		this.sum_heat_unit = sum_heat_unit;
	}

	public Float getSum_flow() {
		return this.sum_flow;
	}

	public void setSum_flow(Float sum_flow) {
		this.sum_flow = sum_flow;
	}

	public Date getRecord_time() {
		return this.record_time;
	}

	public void setRecord_time(Date record_time) {
		this.record_time = record_time;
	}

	public Float getInstant_power() {
		return this.instant_power;
	}

	public void setInstant_power(Float instant_power) {
		this.instant_power = instant_power;
	}

	public Float getSup_water_temp() {
		return this.sup_water_temp;
	}

	public void setSup_water_temp(Float sup_water_temp) {
		this.sup_water_temp = sup_water_temp;
	}

	public Float getBack_water_temp() {
		return this.back_water_temp;
	}

	public void setBack_water_temp(Float back_water_temp) {
		this.back_water_temp = back_water_temp;
	}

	public Float getTemp_diff() {
		return this.temp_diff;
	}

	public void setTemp_diff(Float temp_diff) {
		this.temp_diff = temp_diff;
	}

	public Float getInstant_flow() {
		return this.instant_flow;
	}

	public void setInstant_flow(Float instant_flow) {
		this.instant_flow = instant_flow;
	}

	public Float getRun_hours() {
		return this.run_hours;
	}

	public void setRun_hours(Float run_hours) {
		this.run_hours = run_hours;
	}

	public Float getWrong_hours() {
		return this.wrong_hours;
	}

	public void setWrong_hours(Float wrong_hours) {
		this.wrong_hours = wrong_hours;
	}

	public Float getSys_hours() {
		return this.sys_hours;
	}

	public void setSys_hours(Float sys_hours) {
		this.sys_hours = sys_hours;
	}

	public String getWrong_info() {
		return this.wrong_info;
	}

	public void setWrong_info(String wrong_info) {
		this.wrong_info = wrong_info;
	}

	public String getDemo() {
		return this.demo;
	}

	public void setDemo(String demo) {
		this.demo = demo;
	}
}
